<template>
  <view class="page-message">
    <u-tabs :list="list1" @click="changeComponent" lineColor="#f56c6c"></u-tabs>
    <view class="main">
      <announcement-item v-if="isShow"></announcement-item>
      <questnotice v-else></questnotice>
    </view>
  </view>
</template>

<script>
  export default {
    data() {
      return {
        list1: [{
          name: '公告',
        }, {
          name: '系统通知',
        }],
        isShow:true
      };
    },
    methods:{
      changeComponent(item) {
        console.log('item', item);
        if(item.name === '公告') {
         this.isShow = true
        } else if (item.name = '系统通知') {
        this.isShow = false
        } 
      },
    },
    
  }
</script>

<style lang="scss">
  .main{
    background-color: #F4F4F4;
  }
.u-tabs__wrapper__nav {
  justify-content: space-around !important;
}
</style>
